package com.yes_iot.dao;

import com.yes_iot.entity.VisualMoudle;
import com.yes_iot.entity.VisualMoudleLibrary;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.UUID;

@Repository
public interface VisualMoudleLibraryDao  extends JpaRepository<VisualMoudleLibrary, UUID> {
    @Query("select vml from VisualMoudleLibrary vml where vml.devCode=:devCode")
    List<VisualMoudleLibrary> findVisualMoudelLibraryByDevCode(@Param("devCode") String devCode);
    @Query("select vml from VisualMoudleLibrary vml where vml.visualDisplayParentId=:parentId")
    List<VisualMoudleLibrary> findVisualMoudelLibraryByVisualDisplayParentId(@Param("parentId")UUID parentId);
}
